<?php
//mysql_query("SET NAMES GB2312"); 
class mysql_conn {
	private $db;
	public function __construct($host = "localhost", $user = "live_db", $pass = "live_db", $db = "live_db") {
		$this->db = @ mysql_connect($host, $user, $pass);
		if (!$this->db)
			die(@ mysql_error());
		if ($db != "")
			$dbs = @ mysql_select_db($db);
		if (!$dbs)
			die(@ mysql_error());
	}
	public function __destruct() {
		@ mysql_close($db);
	}
	public function __call($function, $arguments) {
		array_push($arguments, $this->db);
		mysql_query("SET NAMES GB2312");
		$return = call_user_func_array("mysql_" . $function, $arguments);
		if (!$return)
			die(@ mysql_error());
	}
}
?>